3.1.14 \(\int \frac {(A+B x) (a+b x+c x^2)^2}{d+e x+f x^2} \, dx\) [14]

Optimal. Leaf size=542 \[ \frac {\left (B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2}{2 f^3}-\frac {c (B c e-2 b B f-A c f) x^3}{3 f^2}+\frac {B c^2 x^4}{4 f}-\frac {\left (A f \left (c^2 \left (e^4-4 d e^2 f+2 d^2 f^2\right )-f^2 \left (2 a b e f-2 a^2 f^2-b^2 \left (e^2-2 d f\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )\right )-B \left (c^2 \left (e^5-5 d e^3 f+5 d^2 e f^2\right )+f^2 \left (a^2 e f^2-2 a b f \left (e^2-2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )+2 c f \left (a e f \left (e^2-3 d f\right )-b \left (e^4-4 d e^2 f+2 d^2 f^2\right )\right )\right )\right ) \tanh ^{-1}\left (\frac {e+2 f x}{\sqrt {e^2-4 d f}}\right )}{f^5 \sqrt {e^2-4 d f}}+\frac {\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) \log \left (d+e x+f x^2\right )}{2 f^5} \]

[Out]

(B*(-b*f+c*e)*(f*(-2*a*f+b*e)-c*(-2*d*f+e^2))+A*f*(b^2*f^2-2*c*f*(-a*f+b*e)+c^2*(-d*f+e^2)))*x/f^4-1/2*(A*c*f*
(-2*b*f+c*e)-B*(b^2*f^2-2*c*f*(-a*f+b*e)+c^2*(-d*f+e^2)))*x^2/f^3-1/3*c*(-A*c*f-2*B*b*f+B*c*e)*x^3/f^2+1/4*B*c
^2*x^4/f+1/2*(A*f*(-b*f+c*e)*(f*(-2*a*f+b*e)-c*(-2*d*f+e^2))+B*(c^2*(d^2*f^2-3*d*e^2*f+e^4)-f^2*(2*a*b*e*f-a^2
*f^2-b^2*(-d*f+e^2))+2*c*f*(a*f*(-d*f+e^2)-b*(-2*d*e*f+e^3))))*ln(f*x^2+e*x+d)/f^5-(A*f*(c^2*(2*d^2*f^2-4*d*e^
2*f+e^4)-f^2*(2*a*b*e*f-2*a^2*f^2-b^2*(-2*d*f+e^2))+2*c*f*(a*f*(-2*d*f+e^2)-b*(-3*d*e*f+e^3)))-B*(c^2*(5*d^2*e
*f^2-5*d*e^3*f+e^5)+f^2*(a^2*e*f^2-2*a*b*f*(-2*d*f+e^2)+b^2*(-3*d*e*f+e^3))+2*c*f*(a*e*f*(-3*d*f+e^2)-b*(2*d^2
*f^2-4*d*e^2*f+e^4))))*arctanh((2*f*x+e)/(-4*d*f+e^2)^(1/2))/f^5/(-4*d*f+e^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.68, antiderivative size = 542, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1025, 648, 632, 212, 642} \begin {gather*} \frac {\log \left (d+e x+f x^2\right ) \left (B \left (-f^2 \left (-a^2 f^2+2 a b e f-\left (b^2 \left (e^2-d f\right )\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )+c^2 \left (d^2 f^2-3 d e^2 f+e^4\right )\right )+A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )\right )}{2 f^5}-\frac {\tanh ^{-1}\left (\frac {e+2 f x}{\sqrt {e^2-4 d f}}\right ) \left (A f \left (-f^2 \left (-2 a^2 f^2+2 a b e f-\left (b^2 \left (e^2-2 d f\right )\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )+c^2 \left (2 d^2 f^2-4 d e^2 f+e^4\right )\right )-B \left (f^2 \left (a^2 e f^2-2 a b f \left (e^2-2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )+2 c f \left (a e f \left (e^2-3 d f\right )-b \left (2 d^2 f^2-4 d e^2 f+e^4\right )\right )+c^2 \left (5 d^2 e f^2-5 d e^3 f+e^5\right )\right )\right )}{f^5 \sqrt {e^2-4 d f}}+\frac {x \left (A f \left (-2 c f (b e-a f)+b^2 f^2+c^2 \left (e^2-d f\right )\right )+B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )\right )}{f^4}-\frac {x^2 \left (A c f (c e-2 b f)-B \left (-2 c f (b e-a f)+b^2 f^2+c^2 \left (e^2-d f\right )\right )\right )}{2 f^3}-\frac {c x^3 (-A c f-2 b B f+B c e)}{3 f^2}+\frac {B c^2 x^4}{4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(a + b*x + c*x^2)^2)/(d + e*x + f*x^2),x]

[Out]

((B*(c*e - b*f)*(f*(b*e - 2*a*f) - c*(e^2 - 2*d*f)) + A*f*(b^2*f^2 - 2*c*f*(b*e - a*f) + c^2*(e^2 - d*f)))*x)/
f^4 - ((A*c*f*(c*e - 2*b*f) - B*(b^2*f^2 - 2*c*f*(b*e - a*f) + c^2*(e^2 - d*f)))*x^2)/(2*f^3) - (c*(B*c*e - 2*
b*B*f - A*c*f)*x^3)/(3*f^2) + (B*c^2*x^4)/(4*f) - ((A*f*(c^2*(e^4 - 4*d*e^2*f + 2*d^2*f^2) - f^2*(2*a*b*e*f -
2*a^2*f^2 - b^2*(e^2 - 2*d*f)) + 2*c*f*(a*f*(e^2 - 2*d*f) - b*(e^3 - 3*d*e*f))) - B*(c^2*(e^5 - 5*d*e^3*f + 5*
d^2*e*f^2) + f^2*(a^2*e*f^2 - 2*a*b*f*(e^2 - 2*d*f) + b^2*(e^3 - 3*d*e*f)) + 2*c*f*(a*e*f*(e^2 - 3*d*f) - b*(e
^4 - 4*d*e^2*f + 2*d^2*f^2))))*ArcTanh[(e + 2*f*x)/Sqrt[e^2 - 4*d*f]])/(f^5*Sqrt[e^2 - 4*d*f]) + ((A*f*(c*e -
b*f)*(f*(b*e - 2*a*f) - c*(e^2 - 2*d*f)) + B*(c^2*(e^4 - 3*d*e^2*f + d^2*f^2) - f^2*(2*a*b*e*f - a^2*f^2 - b^2
*(e^2 - d*f)) + 2*c*f*(a*f*(e^2 - d*f) - b*(e^3 - 2*d*e*f))))*Log[d + e*x + f*x^2])/(2*f^5)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 1025

Int[((g_.) + (h_.)*(x_))*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_)*((d_) + (e_.)*(x_) + (f_.)*(x_)^2)^(q_), x_Sy
mbol] :> Int[ExpandIntegrand[(a + b*x + c*x^2)^p*(d + e*x + f*x^2)^q*(g + h*x), x], x] /; FreeQ[{a, b, c, d, e
, f, g, h}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[e^2 - 4*d*f, 0] && IGtQ[p, 0] && IntegerQ[q]

Rubi steps

\begin {align*} \int \frac {(A+B x) \left (a+b x+c x^2\right )^2}{d+e x+f x^2} \, dx &=\int \left (\frac {B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^3}-\frac {c (B c e-2 b B f-A c f) x^2}{f^2}+\frac {B c^2 x^3}{f}+\frac {-B d (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (2 c d f (b e-a f)-f^2 \left (b^2 d-a^2 f\right )-c^2 d \left (e^2-d f\right )\right )+\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) x}{f^4 \left (d+e x+f x^2\right )}\right ) \, dx\\ &=\frac {\left (B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2}{2 f^3}-\frac {c (B c e-2 b B f-A c f) x^3}{3 f^2}+\frac {B c^2 x^4}{4 f}+\frac {\int \frac {-B d (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (2 c d f (b e-a f)-f^2 \left (b^2 d-a^2 f\right )-c^2 d \left (e^2-d f\right )\right )+\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) x}{d+e x+f x^2} \, dx}{f^4}\\ &=\frac {\left (B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2}{2 f^3}-\frac {c (B c e-2 b B f-A c f) x^3}{3 f^2}+\frac {B c^2 x^4}{4 f}+\frac {\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) \int \frac {e+2 f x}{d+e x+f x^2} \, dx}{2 f^5}+\frac {\left (A f \left (c^2 \left (e^4-4 d e^2 f+2 d^2 f^2\right )-f^2 \left (2 a b e f-2 a^2 f^2-b^2 \left (e^2-2 d f\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )\right )-B \left (c^2 \left (e^5-5 d e^3 f+5 d^2 e f^2\right )+f^2 \left (a^2 e f^2-2 a b f \left (e^2-2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )+2 c f \left (a e f \left (e^2-3 d f\right )-b \left (e^4-4 d e^2 f+2 d^2 f^2\right )\right )\right )\right ) \int \frac {1}{d+e x+f x^2} \, dx}{2 f^5}\\ &=\frac {\left (B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2}{2 f^3}-\frac {c (B c e-2 b B f-A c f) x^3}{3 f^2}+\frac {B c^2 x^4}{4 f}+\frac {\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) \log \left (d+e x+f x^2\right )}{2 f^5}-\frac {\left (A f \left (c^2 \left (e^4-4 d e^2 f+2 d^2 f^2\right )-f^2 \left (2 a b e f-2 a^2 f^2-b^2 \left (e^2-2 d f\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )\right )-B \left (c^2 \left (e^5-5 d e^3 f+5 d^2 e f^2\right )+f^2 \left (a^2 e f^2-2 a b f \left (e^2-2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )+2 c f \left (a e f \left (e^2-3 d f\right )-b \left (e^4-4 d e^2 f+2 d^2 f^2\right )\right )\right )\right ) \text {Subst}\left (\int \frac {1}{e^2-4 d f-x^2} \, dx,x,e+2 f x\right )}{f^5}\\ &=\frac {\left (B (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x}{f^4}-\frac {\left (A c f (c e-2 b f)-B \left (b^2 f^2-2 c f (b e-a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2}{2 f^3}-\frac {c (B c e-2 b B f-A c f) x^3}{3 f^2}+\frac {B c^2 x^4}{4 f}-\frac {\left (A f \left (c^2 \left (e^4-4 d e^2 f+2 d^2 f^2\right )-f^2 \left (2 a b e f-2 a^2 f^2-b^2 \left (e^2-2 d f\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )\right )-B \left (c^2 \left (e^5-5 d e^3 f+5 d^2 e f^2\right )+f^2 \left (a^2 e f^2-2 a b f \left (e^2-2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )+2 c f \left (a e f \left (e^2-3 d f\right )-b \left (e^4-4 d e^2 f+2 d^2 f^2\right )\right )\right )\right ) \tanh ^{-1}\left (\frac {e+2 f x}{\sqrt {e^2-4 d f}}\right )}{f^5 \sqrt {e^2-4 d f}}+\frac {\left (A f (c e-b f) \left (f (b e-2 a f)-c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )-f^2 \left (2 a b e f-a^2 f^2-b^2 \left (e^2-d f\right )\right )+2 c f \left (a f \left (e^2-d f\right )-b \left (e^3-2 d e f\right )\right )\right )\right ) \log \left (d+e x+f x^2\right )}{2 f^5}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.41, size = 535, normalized size = 0.99 \begin {gather*} \frac {12 f \left (-B (c e-b f) \left (f (-b e+2 a f)+c \left (e^2-2 d f\right )\right )+A f \left (b^2 f^2+2 c f (-b e+a f)+c^2 \left (e^2-d f\right )\right )\right ) x+6 f^2 \left (A c f (-c e+2 b f)+B \left (b^2 f^2+2 c f (-b e+a f)+c^2 \left (e^2-d f\right )\right )\right ) x^2+4 c f^3 (-B c e+2 b B f+A c f) x^3+3 B c^2 f^4 x^4-\frac {12 \left (-A f \left (c^2 \left (e^4-4 d e^2 f+2 d^2 f^2\right )+f^2 \left (-2 a b e f+2 a^2 f^2+b^2 \left (e^2-2 d f\right )\right )+2 c f \left (a f \left (e^2-2 d f\right )-b \left (e^3-3 d e f\right )\right )\right )+B \left (c^2 \left (e^5-5 d e^3 f+5 d^2 e f^2\right )+f^2 \left (a^2 e f^2+2 a b f \left (-e^2+2 d f\right )+b^2 \left (e^3-3 d e f\right )\right )-2 c f \left (-a e f \left (e^2-3 d f\right )+b \left (e^4-4 d e^2 f+2 d^2 f^2\right )\right )\right )\right ) \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {-e^2+4 d f}}\right )}{\sqrt {-e^2+4 d f}}+6 \left (A f (-c e+b f) \left (f (-b e+2 a f)+c \left (e^2-2 d f\right )\right )+B \left (c^2 \left (e^4-3 d e^2 f+d^2 f^2\right )+f^2 \left (-2 a b e f+a^2 f^2+b^2 \left (e^2-d f\right )\right )-2 c f \left (a f \left (-e^2+d f\right )+b \left (e^3-2 d e f\right )\right )\right )\right ) \log (d+x (e+f x))}{12 f^5} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((A + B*x)*(a + b*x + c*x^2)^2)/(d + e*x + f*x^2),x]

[Out]

(12*f*(-(B*(c*e - b*f)*(f*(-(b*e) + 2*a*f) + c*(e^2 - 2*d*f))) + A*f*(b^2*f^2 + 2*c*f*(-(b*e) + a*f) + c^2*(e^
2 - d*f)))*x + 6*f^2*(A*c*f*(-(c*e) + 2*b*f) + B*(b^2*f^2 + 2*c*f*(-(b*e) + a*f) + c^2*(e^2 - d*f)))*x^2 + 4*c
*f^3*(-(B*c*e) + 2*b*B*f + A*c*f)*x^3 + 3*B*c^2*f^4*x^4 - (12*(-(A*f*(c^2*(e^4 - 4*d*e^2*f + 2*d^2*f^2) + f^2*
(-2*a*b*e*f + 2*a^2*f^2 + b^2*(e^2 - 2*d*f)) + 2*c*f*(a*f*(e^2 - 2*d*f) - b*(e^3 - 3*d*e*f)))) + B*(c^2*(e^5 -
 5*d*e^3*f + 5*d^2*e*f^2) + f^2*(a^2*e*f^2 + 2*a*b*f*(-e^2 + 2*d*f) + b^2*(e^3 - 3*d*e*f)) - 2*c*f*(-(a*e*f*(e
^2 - 3*d*f)) + b*(e^4 - 4*d*e^2*f + 2*d^2*f^2))))*ArcTan[(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]])/Sqrt[-e^2 + 4*d*f] +
 6*(A*f*(-(c*e) + b*f)*(f*(-(b*e) + 2*a*f) + c*(e^2 - 2*d*f)) + B*(c^2*(e^4 - 3*d*e^2*f + d^2*f^2) + f^2*(-2*a
*b*e*f + a^2*f^2 + b^2*(e^2 - d*f)) - 2*c*f*(a*f*(-e^2 + d*f) + b*(e^3 - 2*d*e*f))))*Log[d + x*(e + f*x)])/(12
*f^5)

________________________________________________________________________________________

Maple [A]
time = 0.27, size = 800, normalized size = 1.48

method result size
default \(\frac {\frac {1}{4} B \,c^{2} x^{4} f^{3}+\frac {1}{3} A \,c^{2} f^{3} x^{3}+\frac {2}{3} B b c \,f^{3} x^{3}-\frac {1}{3} B \,c^{2} e \,f^{2} x^{3}+A b c \,f^{3} x^{2}-\frac {1}{2} A \,c^{2} e \,f^{2} x^{2}+B a c \,f^{3} x^{2}+\frac {1}{2} B \,b^{2} f^{3} x^{2}-B b c e \,f^{2} x^{2}-\frac {1}{2} B \,c^{2} d \,f^{2} x^{2}+\frac {1}{2} B \,c^{2} e^{2} f \,x^{2}+2 A a c \,f^{3} x +A \,b^{2} f^{3} x -2 A b c e \,f^{2} x -A \,c^{2} d \,f^{2} x +A \,c^{2} e^{2} f x +2 B a b \,f^{3} x -2 B a c e \,f^{2} x -B \,b^{2} e \,f^{2} x -2 B b c d \,f^{2} x +2 B b c \,e^{2} f x +2 B \,c^{2} d e f x -B \,c^{2} e^{3} x}{f^{4}}+\frac {\frac {\left (2 A a b \,f^{4}-2 A a c e \,f^{3}-A \,b^{2} e \,f^{3}-2 A b c d \,f^{3}+2 A b c \,e^{2} f^{2}+2 A \,c^{2} d e \,f^{2}-A \,c^{2} e^{3} f +B \,a^{2} f^{4}-2 B a b e \,f^{3}-2 B a c d \,f^{3}+2 B a c \,e^{2} f^{2}-B \,b^{2} d \,f^{3}+B \,b^{2} e^{2} f^{2}+4 B b c d e \,f^{2}-2 B b c \,e^{3} f +B \,c^{2} d^{2} f^{2}-3 B \,c^{2} d \,e^{2} f +B \,c^{2} e^{4}\right ) \ln \left (f \,x^{2}+e x +d \right )}{2 f}+\frac {2 \left (A \,a^{2} f^{4}-2 A a c d \,f^{3}-A \,b^{2} d \,f^{3}+2 A b c d e \,f^{2}+A \,c^{2} d^{2} f^{2}-A \,c^{2} d \,e^{2} f -2 B a b d \,f^{3}+2 B a c d e \,f^{2}+B \,b^{2} d e \,f^{2}+2 B b c \,d^{2} f^{2}-2 B b c d \,e^{2} f -2 B \,c^{2} d^{2} e f +B \,c^{2} d \,e^{3}-\frac {\left (2 A a b \,f^{4}-2 A a c e \,f^{3}-A \,b^{2} e \,f^{3}-2 A b c d \,f^{3}+2 A b c \,e^{2} f^{2}+2 A \,c^{2} d e \,f^{2}-A \,c^{2} e^{3} f +B \,a^{2} f^{4}-2 B a b e \,f^{3}-2 B a c d \,f^{3}+2 B a c \,e^{2} f^{2}-B \,b^{2} d \,f^{3}+B \,b^{2} e^{2} f^{2}+4 B b c d e \,f^{2}-2 B b c \,e^{3} f +B \,c^{2} d^{2} f^{2}-3 B \,c^{2} d \,e^{2} f +B \,c^{2} e^{4}\right ) e}{2 f}\right ) \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right )}{\sqrt {4 d f -e^{2}}}}{f^{4}}\) \(800\)
risch \(\text {Expression too large to display}\) \(60299\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+e*x+d),x,method=_RETURNVERBOSE)

[Out]

1/f^4*(1/4*B*c^2*x^4*f^3+1/3*A*c^2*f^3*x^3+2/3*B*b*c*f^3*x^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*d*e^2*f+B*c^2*e^4)*e/f)/(
4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-%e^2>0)', see `assume?`
for more det

________________________________________________________________________________________

Fricas [A]
time = 0.51, size = 1921, normalized size = 3.54 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

[1/12*(12*B*c^2*d*f^5*x^4 + 16*(2*B*b*c + A*c^2)*d*f^5*x^3 + 12*B*c^2*f*x*e^5 - 24*(B*c^2*d^2*f^4 - (B*b^2 + 2
*(B*a + A*b)*c)*d*f^5)*x^2 + 6*(2*A*a^2*f^5 + 2*(2*B*b*c + A*c^2)*d^2*f^3 - 2*(2*B*a*b + A*b^2 + 2*A*a*c)*d*f^
4 - B*c^2*e^5 + (2*B*b*c + A*c^2)*f*e^4 + (5*B*c^2*d*f - (B*b^2 + 2*(B*a + A*b)*c)*f^2)*e^3 - (4*(2*B*b*c + A*
c^2)*d*f^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*f^3)*e^2 - (5*B*c^2*d^2*f^2 - 3*(B*b^2 + 2*(B*a + A*b)*c)*d*f^3 + (B*
a^2 + 2*A*a*b)*f^4)*e)*sqrt(-4*d*f + e^2)*log((2*f^2*x^2 + 2*f*x*e - 2*d*f + sqrt(-4*d*f + e^2)*(2*f*x + e) +
e^2)/(f*x^2 + x*e + d)) - 48*((2*B*b*c + A*c^2)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*(2*B*b*c + A*c^2)*d*f^2 - (2*B*a*b + A*b^2 + 2*A*a*c)*f^3)*e^3 - (13*B*c^2*d^2*f^2
 - 5*(B*b^2 + 2*(B*a + A*b)*c)*d*f^3 + (B*a^2 + 2*A*a*b)*f^4)*e^2 + 4*(2*(2*B*b*c + A*c^2)*d^2*f^3 - (2*B*a*b
+ A*b^2 + 2*A*a*c)*d*f^4)*e)*log(f*x^2 + x*e + d))/(4*d*f^6 - f^5*e^2)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 4663 vs. \(2 (520) = 1040\).
time = 91.26, size = 4663, normalized size = 8.60 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x**2+b*x+a)**2/(f*x**2+e*x+d),x)

[Out]

B*c**2*x**4/(4*f) + x**3*(A*c**2/(3*f) + 2*B*b*c/(3*f) - B*c**2*e/(3*f**2)) + x**2*(A*b*c/f - A*c**2*e/(2*f**2
) + B*a*c/f + B*b**2/(2*f) - B*b*c*e/f**2 - B*c**2*d/(2*f**2) + B*c**2*e**2/(2*f**3)) + x*(2*A*a*c/f + A*b**2/
f - 2*A*b*c*e/f**2 - A*c**2*d/f**2 + A*c**2*e**2/f**3 + 2*B*a*b/f - 2*B*a*c*e/f**2 - B*b**2*e/f**2 - 2*B*b*c*d
/f**2 + 2*B*b*c*e**2/f**3 + 2*B*c**2*d*e/f**3 - B*c**2*e**3/f**4) + (-sqrt(-4*d*f + e**2)*(-2*A*a**2*f**5 + 2*
A*a*b*e*f**4 + 4*A*a*c*d*f**4 - 2*A*a*c*e**2*f**3 + 2*A*b**2*d*f**4 - A*b**2*e**2*f**3 - 6*A*b*c*d*e*f**3 + 2*
A*b*c*e**3*f**2 - 2*A*c**2*d**2*f**3 + 4*A*c**2*d*e**2*f**2 - A*c**2*e**4*f + B*a**2*e*f**4 + 4*B*a*b*d*f**4 -
 2*B*a*b*e**2*f**3 - 6*B*a*c*d*e*f**3 + 2*B*a*c*e**3*f**2 - 3*B*b**2*d*e*f**3 + B*b**2*e**3*f**2 - 4*B*b*c*d**
2*f**3 + 8*B*b*c*d*e**2*f**2 - 2*B*b*c*e**4*f + 5*B*c**2*d**2*e*f**2 - 5*B*c**2*d*e**3*f + B*c**2*e**5)/(2*f**
5*(4*d*f - e**2)) + (2*A*a*b*f**4 - 2*A*a*c*e*f**3 - A*b**2*e*f**3 - 2*A*b*c*d*f**3 + 2*A*b*c*e**2*f**2 + 2*A*
c**2*d*e*f**2 - A*c**2*e**3*f + B*a**2*f**4 - 2*B*a*b*e*f**3 - 2*B*a*c*d*f**3 + 2*B*a*c*e**2*f**2 - B*b**2*d*f
**3 + B*b**2*e**2*f**2 + 4*B*b*c*d*e*f**2 - 2*B*b*c*e**3*f + B*c**2*d**2*f**2 - 3*B*c**2*d*e**2*f + B*c**2*e**
4)/(2*f**5))*log(x + (-A*a**2*e*f**4 + 4*A*a*b*d*f**4 - 2*A*a*c*d*e*f**3 - A*b**2*d*e*f**3 - 4*A*b*c*d**2*f**3
 + 2*A*b*c*d*e**2*f**2 + 3*A*c**2*d**2*e*f**2 - A*c**2*d*e**3*f + 2*B*a**2*d*f**4 - 2*B*a*b*d*e*f**3 - 4*B*a*c
*d**2*f**3 + 2*B*a*c*d*e**2*f**2 - 2*B*b**2*d**2*f**3 + B*b**2*d*e**2*f**2 + 6*B*b*c*d**2*e*f**2 - 2*B*b*c*d*e
**3*f + 2*B*c**2*d**3*f**2 - 4*B*c**2*d**2*e**2*f + B*c**2*d*e**4 - 4*d*f**5*(-sqrt(-4*d*f + e**2)*(-2*A*a**2*
f**5 + 2*A*a*b*e*f**4 + 4*A*a*c*d*f**4 - 2*A*a*c*e**2*f**3 + 2*A*b**2*d*f**4 - A*b**2*e**2*f**3 - 6*A*b*c*d*e*
f**3 + 2*A*b*c*e**3*f**2 - 2*A*c**2*d**2*f**3 + 4*A*c**2*d*e**2*f**2 - A*c**2*e**4*f + B*a**2*e*f**4 + 4*B*a*b
*d*f**4 - 2*B*a*b*e**2*f**3 - 6*B*a*c*d*e*f**3 + 2*B*a*c*e**3*f**2 - 3*B*b**2*d*e*f**3 + B*b**2*e**3*f**2 - 4*
B*b*c*d**2*f**3 + 8*B*b*c*d*e**2*f**2 - 2*B*b*c*e**4*f + 5*B*c**2*d**2*e*f**2 - 5*B*c**2*d*e**3*f + B*c**2*e**
5)/(2*f**5*(4*d*f - e**2)) + (2*A*a*b*f**4 - 2*A*a*c*e*f**3 - A*b**2*e*f**3 - 2*A*b*c*d*f**3 + 2*A*b*c*e**2*f*
*2 + 2*A*c**2*d*e*f**2 - A*c**2*e**3*f + B*a**2*f**4 - 2*B*a*b*e*f**3 - 2*B*a*c*d*f**3 + 2*B*a*c*e**2*f**2 - B
*b**2*d*f**3 + B*b**2*e**2*f**2 + 4*B*b*c*d*e*f**2 - 2*B*b*c*e**3*f + B*c**2*d**2*f**2 - 3*B*c**2*d*e**2*f + B
*c**2*e**4)/(2*f**5)) + e**2*f**4*(-sqrt(-4*d*f + e**2)*(-2*A*a**2*f**5 + 2*A*a*b*e*f**4 + 4*A*a*c*d*f**4 - 2*
A*a*c*e**2*f**3 + 2*A*b**2*d*f**4 - A*b**2*e**2*f**3 - 6*A*b*c*d*e*f**3 + 2*A*b*c*e**3*f**2 - 2*A*c**2*d**2*f*
*3 + 4*A*c**2*d*e**2*f**2 - A*c**2*e**4*f + B*a**2*e*f**4 + 4*B*a*b*d*f**4 - 2*B*a*b*e**2*f**3 - 6*B*a*c*d*e*f
**3 + 2*B*a*c*e**3*f**2 - 3*B*b**2*d*e*f**3 + B*b**2*e**3*f**2 - 4*B*b*c*d**2*f**3 + 8*B*b*c*d*e**2*f**2 - 2*B
*b*c*e**4*f + 5*B*c**2*d**2*e*f**2 - 5*B*c**2*d*e**3*f + B*c**2*e**5)/(2*f**5*(4*d*f - e**2)) + (2*A*a*b*f**4
- 2*A*a*c*e*f**3 - A*b**2*e*f**3 - 2*A*b*c*d*f**3 + 2*A*b*c*e**2*f**2 + 2*A*c**2*d*e*f**2 - A*c**2*e**3*f + B*
a**2*f**4 - 2*B*a*b*e*f**3 - 2*B*a*c*d*f**3 + 2*B*a*c*e**2*f**2 - B*b**2*d*f**3 + B*b**2*e**2*f**2 + 4*B*b*c*d
*e*f**2 - 2*B*b*c*e**3*f + B*c**2*d**2*f**2 - 3*B*c**2*d*e**2*f + B*c**2*e**4)/(2*f**5)))/(-2*A*a**2*f**5 + 2*
A*a*b*e*f**4 + 4*A*a*c*d*f**4 - 2*A*a*c*e**2*f**3 + 2*A*b**2*d*f**4 - A*b**2*e**2*f**3 - 6*A*b*c*d*e*f**3 + 2*
A*b*c*e**3*f**2 - 2*A*c**2*d**2*f**3 + 4*A*c**2*d*e**2*f**2 - A*c**2*e**4*f + B*a**2*e*f**4 + 4*B*a*b*d*f**4 -
 2*B*a*b*e**2*f**3 - 6*B*a*c*d*e*f**3 + 2*B*a*c*e**3*f**2 - 3*B*b**2*d*e*f**3 + B*b**2*e**3*f**2 - 4*B*b*c*d**
2*f**3 + 8*B*b*c*d*e**2*f**2 - 2*B*b*c*e**4*f + 5*B*c**2*d**2*e*f**2 - 5*B*c**2*d*e**3*f + B*c**2*e**5)) + (sq
rt(-4*d*f + e**2)*(-2*A*a**2*f**5 + 2*A*a*b*e*f**4 + 4*A*a*c*d*f**4 - 2*A*a*c*e**2*f**3 + 2*A*b**2*d*f**4 - A*
b**2*e**2*f**3 - 6*A*b*c*d*e*f**3 + 2*A*b*c*e**3*f**2 - 2*A*c**2*d**2*f**3 + 4*A*c**2*d*e**2*f**2 - A*c**2*e**
4*f + B*a**2*e*f**4 + 4*B*a*b*d*f**4 - 2*B*a*b*e**2*f**3 - 6*B*a*c*d*e*f**3 + 2*B*a*c*e**3*f**2 - 3*B*b**2*d*e
*f**3 + B*b**2*e**3*f**2 - 4*B*b*c*d**2*f**3 + 8*B*b*c*d*e**2*f**2 - 2*B*b*c*e**4*f + 5*B*c**2*d**2*e*f**2 - 5
*B*c**2*d*e**3*f + B*c**2*e**5)/(2*f**5*(4*d*f - e**2)) + (2*A*a*b*f**4 - 2*A*a*c*e*f**3 - A*b**2*e*f**3 - 2*A
*b*c*d*f**3 + 2*A*b*c*e**2*f**2 + 2*A*c**2*d*e*f**2 - A*c**2*e**3*f + B*a**2*f**4 - 2*B*a*b*e*f**3 - 2*B*a*c*d
*f**3 + 2*B*a*c*e**2*f**2 - B*b**2*d*f**3 + B*b**2*e**2*f**2 + 4*B*b*c*d*e*f**2 - 2*B*b*c*e**3*f + B*c**2*d**2
*f**2 - 3*B*c**2*d*e**2*f + B*c**2*e**4)/(2*f**5))*log(x + (-A*a**2*e*f**4 + 4*A*a*b*d*f**4 - 2*A*a*c*d*e*f**3
 - A*b**2*d*e*f**3 - 4*A*b*c*d**2*f**3 + 2*A*b*c*d*e**2*f**2 + 3*A*c**2*d**2*e*f**2 - A*c**2*d*e**3*f + 2*B*a*
*2*d*f**4 - 2*B*a*b*d*e*f**3 - 4*B*a*c*d**2*f**3 + 2*B*a*c*d*e**2*f**2 - 2*B*b**2*d**2*f**3 + B*b**2*d*e**2*f*
*2 + 6*B*b*c*d**2*e*f**2 - 2*B*b*c*d*e**3*f + 2*B*c**2*d**3*f**2 - 4*B*c**2*d**2*e**2*f + B*c**2*d*e**4 - 4*d*
f**5*(sqrt(-4*d*f + e**2)*(-2*A*a**2*f**5 + 2*A...

________________________________________________________________________________________

Giac [A]
time = 3.08, size = 738, normalized size = 1.36 \begin {gather*} \frac {3 \, B c^{2} f^{3} x^{4} + 8 \, B b c f^{3} x^{3} + 4 \, A c^{2} f^{3} x^{3} - 4 \, B c^{2} f^{2} x^{3} e - 6 \, B c^{2} d f^{2} x^{2} + 6 \, B b^{2} f^{3} x^{2} + 12 \, B a c f^{3} x^{2} + 12 \, A b c f^{3} x^{2} - 12 \, B b c f^{2} x^{2} e - 6 \, A c^{2} f^{2} x^{2} e - 24 \, B b c d f^{2} x - 12 \, A c^{2} d f^{2} x + 24 \, B a b f^{3} x + 12 \, A b^{2} f^{3} x + 24 \, A a c f^{3} x + 6 \, B c^{2} f x^{2} e^{2} + 24 \, B c^{2} d f x e - 12 \, B b^{2} f^{2} x e - 24 \, B a c f^{2} x e - 24 \, A b c f^{2} x e + 24 \, B b c f x e^{2} + 12 \, A c^{2} f x e^{2} - 12 \, B c^{2} x e^{3}}{12 \, f^{4}} + \frac {{\left (B c^{2} d^{2} f^{2} - B b^{2} d f^{3} - 2 \, B a c d f^{3} - 2 \, A b c d f^{3} + B a^{2} f^{4} + 2 \, A a b f^{4} + 4 \, B b c d f^{2} e + 2 \, A c^{2} d f^{2} e - 2 \, B a b f^{3} e - A b^{2} f^{3} e - 2 \, A a c f^{3} e - 3 \, B c^{2} d f e^{2} + B b^{2} f^{2} e^{2} + 2 \, B a c f^{2} e^{2} + 2 \, A b c f^{2} e^{2} - 2 \, B b c f e^{3} - A c^{2} f e^{3} + B c^{2} e^{4}\right )} \log \left (f x^{2} + x e + d\right )}{2 \, f^{5}} + \frac {{\left (4 \, B b c d^{2} f^{3} + 2 \, A c^{2} d^{2} f^{3} - 4 \, B a b d f^{4} - 2 \, A b^{2} d f^{4} - 4 \, A a c d f^{4} + 2 \, A a^{2} f^{5} - 5 \, B c^{2} d^{2} f^{2} e + 3 \, B b^{2} d f^{3} e + 6 \, B a c d f^{3} e + 6 \, A b c d f^{3} e - B a^{2} f^{4} e - 2 \, A a b f^{4} e - 8 \, B b c d f^{2} e^{2} - 4 \, A c^{2} d f^{2} e^{2} + 2 \, B a b f^{3} e^{2} + A b^{2} f^{3} e^{2} + 2 \, A a c f^{3} e^{2} + 5 \, B c^{2} d f e^{3} - B b^{2} f^{2} e^{3} - 2 \, B a c f^{2} e^{3} - 2 \, A b c f^{2} e^{3} + 2 \, B b c f e^{4} + A c^{2} f e^{4} - B c^{2} e^{5}\right )} \arctan \left (\frac {2 \, f x + e}{\sqrt {4 \, d f - e^{2}}}\right )}{\sqrt {4 \, d f - e^{2}} f^{5}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^2/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

1/12*(3*B*c^2*f^3*x^4 + 8*B*b*c*f^3*x^3 + 4*A*c^2*f^3*x^3 - 4*B*c^2*f^2*x^3*e - 6*B*c^2*d*f^2*x^2 + 6*B*b^2*f^
3*x^2 + 12*B*a*c*f^3*x^2 + 12*A*b*c*f^3*x^2 - 12*B*b*c*f^2*x^2*e - 6*A*c^2*f^2*x^2*e - 24*B*b*c*d*f^2*x - 12*A
*c^2*d*f^2*x + 24*B*a*b*f^3*x + 12*A*b^2*f^3*x + 24*A*a*c*f^3*x + 6*B*c^2*f*x^2*e^2 + 24*B*c^2*d*f*x*e - 12*B*
b^2*f^2*x*e - 24*B*a*c*f^2*x*e - 24*A*b*c*f^2*x*e + 24*B*b*c*f*x*e^2 + 12*A*c^2*f*x*e^2 - 12*B*c^2*x*e^3)/f^4
+ 1/2*(B*c^2*d^2*f^2 - B*b^2*d*f^3 - 2*B*a*c*d*f^3 - 2*A*b*c*d*f^3 + B*a^2*f^4 + 2*A*a*b*f^4 + 4*B*b*c*d*f^2*e
 + 2*A*c^2*d*f^2*e - 2*B*a*b*f^3*e - A*b^2*f^3*e - 2*A*a*c*f^3*e - 3*B*c^2*d*f*e^2 + B*b^2*f^2*e^2 + 2*B*a*c*f
^2*e^2 + 2*A*b*c*f^2*e^2 - 2*B*b*c*f*e^3 - A*c^2*f*e^3 + B*c^2*e^4)*log(f*x^2 + x*e + d)/f^5 + (4*B*b*c*d^2*f^
3 + 2*A*c^2*d^2*f^3 - 4*B*a*b*d*f^4 - 2*A*b^2*d*f^4 - 4*A*a*c*d*f^4 + 2*A*a^2*f^5 - 5*B*c^2*d^2*f^2*e + 3*B*b^
2*d*f^3*e + 6*B*a*c*d*f^3*e + 6*A*b*c*d*f^3*e - B*a^2*f^4*e - 2*A*a*b*f^4*e - 8*B*b*c*d*f^2*e^2 - 4*A*c^2*d*f^
2*e^2 + 2*B*a*b*f^3*e^2 + A*b^2*f^3*e^2 + 2*A*a*c*f^3*e^2 + 5*B*c^2*d*f*e^3 - B*b^2*f^2*e^3 - 2*B*a*c*f^2*e^3
- 2*A*b*c*f^2*e^3 + 2*B*b*c*f*e^4 + A*c^2*f*e^4 - B*c^2*e^5)*arctan((2*f*x + e)/sqrt(4*d*f - e^2))/(sqrt(4*d*f
 - e^2)*f^5)

________________________________________________________________________________________

Mupad [B]
time = 4.85, size = 893, normalized size = 1.65 \begin {gather*} x^3\,\left (\frac {A\,c^2+2\,B\,b\,c}{3\,f}-\frac {B\,c^2\,e}{3\,f^2}\right )+x\,\left (\frac {A\,b^2+2\,B\,a\,b+2\,A\,a\,c}{f}-\frac {d\,\left (\frac {A\,c^2+2\,B\,b\,c}{f}-\frac {B\,c^2\,e}{f^2}\right )}{f}+\frac {e\,\left (\frac {e\,\left (\frac {A\,c^2+2\,B\,b\,c}{f}-\frac {B\,c^2\,e}{f^2}\right )}{f}-\frac {B\,b^2+2\,A\,c\,b+2\,B\,a\,c}{f}+\frac {B\,c^2\,d}{f^2}\right )}{f}\right )-x^2\,\left (\frac {e\,\left (\frac {A\,c^2+2\,B\,b\,c}{f}-\frac {B\,c^2\,e}{f^2}\right )}{2\,f}-\frac {B\,b^2+2\,A\,c\,b+2\,B\,a\,c}{2\,f}+\frac {B\,c^2\,d}{2\,f^2}\right )-\frac {\ln \left (f\,x^2+e\,x+d\right )\,\left (-4\,B\,a^2\,d\,f^5+B\,a^2\,e^2\,f^4+8\,B\,a\,b\,d\,e\,f^4-8\,A\,a\,b\,d\,f^5-2\,B\,a\,b\,e^3\,f^3+2\,A\,a\,b\,e^2\,f^4+8\,B\,a\,c\,d^2\,f^4-10\,B\,a\,c\,d\,e^2\,f^3+8\,A\,a\,c\,d\,e\,f^4+2\,B\,a\,c\,e^4\,f^2-2\,A\,a\,c\,e^3\,f^3+4\,B\,b^2\,d^2\,f^4-5\,B\,b^2\,d\,e^2\,f^3+4\,A\,b^2\,d\,e\,f^4+B\,b^2\,e^4\,f^2-A\,b^2\,e^3\,f^3-16\,B\,b\,c\,d^2\,e\,f^3+8\,A\,b\,c\,d^2\,f^4+12\,B\,b\,c\,d\,e^3\,f^2-10\,A\,b\,c\,d\,e^2\,f^3-2\,B\,b\,c\,e^5\,f+2\,A\,b\,c\,e^4\,f^2-4\,B\,c^2\,d^3\,f^3+13\,B\,c^2\,d^2\,e^2\,f^2-8\,A\,c^2\,d^2\,e\,f^3-7\,B\,c^2\,d\,e^4\,f+6\,A\,c^2\,d\,e^3\,f^2+B\,c^2\,e^6-A\,c^2\,e^5\,f\right )}{2\,\left (4\,d\,f^6-e^2\,f^5\right )}+\frac {B\,c^2\,x^4}{4\,f}+\frac {\mathrm {atan}\left (\frac {e}{\sqrt {4\,d\,f-e^2}}+\frac {2\,f\,x}{\sqrt {4\,d\,f-e^2}}\right )\,\left (-B\,a^2\,e\,f^4+2\,A\,a^2\,f^5-4\,B\,a\,b\,d\,f^4+2\,B\,a\,b\,e^2\,f^3-2\,A\,a\,b\,e\,f^4+6\,B\,a\,c\,d\,e\,f^3-4\,A\,a\,c\,d\,f^4-2\,B\,a\,c\,e^3\,f^2+2\,A\,a\,c\,e^2\,f^3+3\,B\,b^2\,d\,e\,f^3-2\,A\,b^2\,d\,f^4-B\,b^2\,e^3\,f^2+A\,b^2\,e^2\,f^3+4\,B\,b\,c\,d^2\,f^3-8\,B\,b\,c\,d\,e^2\,f^2+6\,A\,b\,c\,d\,e\,f^3+2\,B\,b\,c\,e^4\,f-2\,A\,b\,c\,e^3\,f^2-5\,B\,c^2\,d^2\,e\,f^2+2\,A\,c^2\,d^2\,f^3+5\,B\,c^2\,d\,e^3\,f-4\,A\,c^2\,d\,e^2\,f^2-B\,c^2\,e^5+A\,c^2\,e^4\,f\right )}{f^5\,\sqrt {4\,d\,f-e^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x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c^2*e^4*f + A*b^2*e^2*f^3 + 2*A*c^2*d^2*f^
3 - B*b^2*e^3*f^2 - 4*A*c^2*d*e^2*f^2 - 5*B*c^2*d^2*e*f^2 - 2*A*a*b*e*f^4 - 4*A*a*c*d*f^4 - 4*B*a*b*d*f^4 + 2*
B*b*c*e^4*f + 2*A*a*c*e^2*f^3 + 2*B*a*b*e^2*f^3 - 2*A*b*c*e^3*f^2 - 2*B*a*c*e^3*f^2 + 4*B*b*c*d^2*f^3 + 3*B*b^
2*d*e*f^3 + 5*B*c^2*d*e^3*f - 8*B*b*c*d*e^2*f^2 + 6*A*b*c*d*e*f^3 + 6*B*a*c*d*e*f^3))/(f^5*(4*d*f - e^2)^(1/2)
)

________________________________________________________________________________________